ARG BASE_IMAGE=ubuntu:bionic
FROM ${BASE_IMAGE}

RUN apt-get -qq update && apt-get -qq install -y curl unzip make git clang clang-format cppcheck python3-pip
RUN python3 -m pip install -qq pre-commit cpplint -i https://mirrors.aliyun.com/pypi/simple/
RUN curl -Ls https://golang.google.cn/dl/go1.14.6.linux-amd64.tar.gz | tar -C /usr/local -xz
ENV GO111MODULE on
ENV GOPROXY https://goproxy.io
RUN GOPATH=/go /usr/local/go/bin/go get golang.org/x/lint/golint
RUN GOPATH=/go /usr/local/go/bin/go get github.com/stretchr/testify
RUN cp /go/bin/* /usr/local/bin/

RUN echo 'export GOPATH=/go' >> /root/.bashrc
RUN echo 'export GOPROXY=https://goproxy.io' >> /root/.bashrc
RUN echo 'export PATH=/usr/local/go/bin:/go/bin:$PATH' >> /root/.bashrc
RUN echo 'export LD_LIBRARY_PATH=$GOPATH/src/github.com/wangkuiyi/gotorch/cgotorch/libtorch/lib'
